﻿<UserControl x:Class="QuanLyKho.ucDSXuatKho"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
        xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
        xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars" 
        xmlns:my="clr-namespace:QuanLyKho.CommonControl">
    <!--<UserControl.Resources>
        <Style TargetType="Label">
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
        <Style TargetType="dxe:DateEdit">
            <Setter Property="Margin" Value="2,2" />
        </Style>
        <Style TargetType="dxe:ComboBoxEdit">
            <Setter Property="Margin" Value="1,1" />
        </Style>
        <Style TargetType="Button">
            <Setter Property="Margin" Value="3,3" />
        </Style>
    </UserControl.Resources>-->
    <Grid>
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="160"></RowDefinition>
                <RowDefinition Height="5"></RowDefinition>
                <RowDefinition Height="1*"></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <GroupBox Header="Thông tin tìm kiếm">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="28"></RowDefinition>
                        <RowDefinition Height="28"></RowDefinition>
                        <RowDefinition Height="28"></RowDefinition>
                        <RowDefinition Height="10"></RowDefinition>
                        <RowDefinition Height="30"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="360"></ColumnDefinition>
                        <ColumnDefinition Width="10"></ColumnDefinition>
                        <ColumnDefinition Width="100"></ColumnDefinition>
                        <ColumnDefinition Width="140"></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <my:CalendarControl x:Name="calendar" Grid.RowSpan="4"></my:CalendarControl>
                    <StackPanel Orientation="Horizontal" Grid.ColumnSpan="2" Grid.Column="0" Grid.Row="4">
                        <Button Content="Tìm _kiếm" Name="btnTimKiem" Width="80" Click="btnTimKiem_Click" Margin="2,2"/>
                        <Button Content="_Thêm mới" Name="btnThemMoi" Width="80" Click="btnThemMoi_Click" Margin="2,2"/>
                        <Button Content="Đó_ng" Name="btnDong" Width="80" Click="btnDong_Click" Margin="2,2"/>
                    </StackPanel>
                </Grid>
            </GroupBox>
            <dxg:GridControl Grid.Row="2" Name="gridPhieuXuat">
                <dxg:GridControl.Columns>
                    <dxg:GridColumn Header="Id Phiếu Xuất" FieldName="IdPhieuXuat" AllowEditing="False" Width="100">
                        <dxg:GridColumn.EditSettings>
                            <dxe:TextEditSettings HorizontalContentAlignment="Center"/>
                        </dxg:GridColumn.EditSettings>
                    </dxg:GridColumn>
                    <dxg:GridColumn Header="Ngày Xuất" FieldName="NgayXuat" AllowEditing="False" Width="130">
                        <dxg:GridColumn.EditSettings>
                            <dxe:DateEditSettings MaskType="DateTimeAdvancingCaret" DisplayFormat="dd/MM/yyyy hh:mm:ss"/>
                        </dxg:GridColumn.EditSettings>
                    </dxg:GridColumn>
                    <dxg:GridColumn Header="Tổng tiền" FieldName="TongTien" AllowEditing="False" Width="150">
                        <dxg:GridColumn.EditSettings>
                            <dxe:TextEditSettings MaskType="Numeric" Mask="c0" MaskUseAsDisplayFormat="True" MaskCulture="Vietnamese (Vietnam)"/>
                        </dxg:GridColumn.EditSettings>
                    </dxg:GridColumn>
                </dxg:GridControl.Columns>
                <dxg:GridControl.TotalSummary>
                    <dxg:GridSummaryItem FieldName="IdPhieuXuat" SummaryType="Count" DisplayFormat=" {0:n0} Phiếu Xuất"/>
                    <dxg:GridSummaryItem FieldName="TongTien" SummaryType="Sum" DisplayFormat=" Tổng tiền: {0:n0} đ"/>
                </dxg:GridControl.TotalSummary>
                <dxg:GridControl.View>
                    <dxg:TableView Name="tbvPhieu" ShowAutoFilterRow="True"
                                    MultiSelectMode="None"
                                    IsRowCellMenuEnabled="True" NavigationStyle="Row"
                                    ShowTotalSummary="True"
                                    ShowGroupedColumns="False" ShowColumnHeaders="True"  
                                    MaxHeight="1800" Margin="2 2 2 2"
                                    ShowGroupPanel="False" AllowEditing="False" 
                                    AllowDrop="False" AllowGrouping="False" AllowMoveColumnToDropArea="False" 
                                    AllowMoving="False" IsColumnMenuEnabled="False" IsDeferredScrolling="False" 
                                    IsGroupPanelMenuEnabled="False"
                                    IsTotalSummaryMenuEnabled="False">
                        <dxg:TableView.RowCellMenuCustomizations>
                            <dxb:BarButtonItem Name="BarButtonItemXemChiTiet" Content="Xem chi tiết" ItemClick="BarButtonItemXemChiTiet_ItemClick"/>
                            <dxb:BarButtonItem Name="BarButtonItemXemDanhSachTruocKhiIn" Content="In phiếu" ItemClick="BarButtonItemXemDanhSachTruocKhiIn_ItemClick"/>
                        </dxg:TableView.RowCellMenuCustomizations>
                    </dxg:TableView>
                </dxg:GridControl.View>
            </dxg:GridControl>
            
        </Grid>
    </Grid>
</UserControl>
